import http from "@/utils/request"

declare global {
    interface productParam {
        product_id?: string;
        category_id?: string
    }
    interface addCategoryParam {
        categoryName?: string;
        categoryImgurl?: string
    }
    interface deleteCategoryParam {
        category_id?: string
    }
    interface orderParam {
        order_id?: string;
    }
}

export let getProduct = (params: productParam) => http.get("/product/get_product", {
    params
})

export let postOrder = (params: orderParam) => http.post("/order/get_order", {
    params
})

export let getCategory = () => http.get("/category/getCategory", {})

export let deleteCategory = (params:deleteCategoryParam) => http.get('/category/delCategory', {
    params
})

export const addCategory = (params:addCategoryParam) => http.post('/category/addCategory', {
    params
})

